#ifndef REDIS_MODE_H
#define REDIS_MODE_H

#define  OUT_PUT_FUNC  
#define  OUT_PUT  
#define  IN_PUT

#define  REDIS_CON_TIME_OUT_SEC 1
#define  REDIS_CON_TIME_OUT_MSEC 500

typedef struct {
	unsigned int len;
	unsigned char * data;
 }huidu_model_str;

typedef struct {
	huidu_model_str * data;
	unsigned int size;
 }str_array;

typedef struct  {
	str_array ip_list;
	str_array user_id_list;
	str_array appid_list;
	str_array bbversion_list;
}huidu_info;

typedef struct{
	huidu_model_str ip;				//ip锟斤拷址
	unsigned int cnt_per_intevel;	//ip锟斤拷每锟轿硷拷锟斤拷锟�锟斤拷前锟斤拷锟绞达拷锟斤拷
	unsigned int cnt_his;			//ip 锟侥筹拷锟节凤拷锟绞达拷锟斤拷
}ip_fre_info;						//ip锟斤拷锟斤拷频锟绞碉拷 锟斤拷萁峁�

typedef struct{
	huidu_model_str ip;				//ip锟斤拷址
	unsigned int port;				//锟剿匡拷
}huidu_address_info;


/*
锟斤拷锟絩edis锟斤拷锟斤拷
*/
OUT_PUT_FUNC void set_redis_addr(IN_PUT huidu_address_info *addr, IN_PUT int count);

/*
	锟斤拷锟接碉拷redis
	connet error, return null;
*/
OUT_PUT_FUNC void * connet_to_redis();

/*
锟酵凤拷锟斤拷锟斤拷
*/
OUT_PUT_FUNC void  free_connettion(IN_PUT void *redis_con);

/*
	锟斤拷取(全锟斤拷)锟斤拷锟�
*/
OUT_PUT_FUNC int  get_huidu_info(IN_PUT void *redis_con, OUT_PUT huidu_info * info);


/*
锟酵凤拷锟斤拷锟�
*/
OUT_PUT_FUNC void  free_huidu_info(huidu_info *info); 


#endif









